## API Report File for "@backstage/errors"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { JsonObject } from '@backstage/types';

// @public
export function assertError(value: unknown): asserts value is ErrorLike;

// @public
export class AuthenticationError extends CustomErrorBase {
  // (undocumented)
  name: 'AuthenticationError';
}

// @public
export class ConflictError extends CustomErrorBase {
  // (undocumented)
  name: 'ConflictError';
}

// @public
export type ConsumedResponse = {
  readonly headers: {
    append(name: string, value: string): void;
    delete(name: string): void;
    get(name: string): string | null;
    has(name: string): boolean;
    set(name: string, value: string): void;
    forEach(callback: (value: string, name: string) => void): void;
    entries(): IterableIterator<[string, string]>;
    keys(): IterableIterator<string>;
    values(): IterableIterator<string>;
    [Symbol.iterator](): Iterator<[string, string]>;
  };
  readonly ok: boolean;
  readonly redirected: boolean;
  readonly status: number;
  readonly statusText: string;
  readonly type: ResponseType;
  readonly url: string;
};

// @public
export class CustomErrorBase extends Error {
  constructor(message?: string, cause?: Error | unknown);
  readonly cause?: Error | undefined;
}

// @public
export function deserializeError<T extends Error = Error>(
  data: SerializedError,
): T;

// @public
export type ErrorLike = {
  name: string;
  message: string;
  stack?: string;
  [unknownKeys: string]: unknown;
};

// @public
export type ErrorResponseBody = {
  error: SerializedError;
  request?: {
    method: string;
    url: string;
  };
  response: {
    statusCode: number;
  };
};

// @public
export class ForwardedError extends CustomErrorBase {
  constructor(message: string, cause: Error | unknown);
}

// @public
export class InputError extends CustomErrorBase {
  // (undocumented)
  name: 'InputError';
}

// @public
export function isError(value: unknown): value is ErrorLike;

// @public
export class NotAllowedError extends CustomErrorBase {
  // (undocumented)
  name: 'NotAllowedError';
}

// @public
export class NotFoundError extends CustomErrorBase {
  // (undocumented)
  name: 'NotFoundError';
}

// @public
export class NotImplementedError extends CustomErrorBase {
  // (undocumented)
  name: 'NotImplementedError';
}

// @public
export class NotModifiedError extends CustomErrorBase {
  // (undocumented)
  name: 'NotModifiedError';
}

// @public
export function parseErrorResponseBody(
  response: ConsumedResponse & {
    text(): Promise<string>;
  },
): Promise<ErrorResponseBody>;

// @public
export class ResponseError extends Error {
  readonly body: ErrorResponseBody;
  readonly cause: Error;
  static fromResponse(
    response: ConsumedResponse & {
      text(): Promise<string>;
    },
  ): Promise<ResponseError>;
  readonly response: ConsumedResponse;
}

// @public
export type SerializedError = JsonObject & {
  name: string;
  message: string;
  stack?: string;
  code?: string;
};

// @public
export function serializeError(
  error: Error,
  options?: {
    includeStack?: boolean;
  },
): SerializedError;

// @public
export class ServiceUnavailableError extends CustomErrorBase {}

// @public
export function stringifyError(error: unknown): string;
```
